/** @file bt_debug.h
  *
  * @brief This file contains definitions for displaying HCI Command and
  *        Event name for debugging purpose
  * 
  * (c) Copyright 2003-2008, Marvell International Ltd.
  * All Rights Reserved
  */

#ifndef _BT_DEBUG_H_
#define _BT_DEBUG_H_

#ifdef __cplusplus
extern "C"{
#endif  //__cplusplus

//HCI COMMANDS
#define LINK_CONTROL_COMMANDS             0x01
#define LINK_POLICY_COMMANDS              0x02
#define CONTROLLER_AND_BASEBAND_COMMANDS  0x03
#define INFORMATIONAL_PARAMETERS          0x04
#define STATUS_PARAMETERS                 0x05
#define TESTING_COMMANDS                  0x06

//HCI EVENTS
#define INQUIRY_COMPLETE_EVENT            0x01
#define INQUIRY_RESULT_EVENT                0x02
#define CONNECTION_COMPLETE_EVENT                0x03
#define CONNECTION_REQUEST_EVENT                0x04
#define DISCONNECTION_COMPLETE_EVENT                0x05
#define APPLICATION_COMPLETE_EVENT                0x06
#define REMOTE_NAME_REQUEST_COMPLETE_EVENT                0x07
#define ENCRYPTION_CHANGE_EVENT            0x08
#define CHANGE_CONNECTION_LINK_KEY_COMPLETE_EVENT            0x09
#define MASTER_LINK_KEY_COMPLETE_EVENT            0x0A
#define COMMAND_COMPLETE_EVENT            0x0E
#define COMMAND_STATUS_EVENT            0x0F

#define COMMAND_LEN  50
typedef struct _command_mapping 
{
    WCHAR scommand[COMMAND_LEN];
} command_mappingg_t;
 
static command_mappingg_t Link_Control_Command_String[] =
{
    { L""},  //0x0000   
    { L"HCI_Inquiry"}, //0x0001    
    { L"HCI_Inquiry_Cancel"}, //0x0002    
    { L"HCI_Periodic_Inquiry_Mode"}, //0x0003  
    { L"HCI_Exit_Periodic_Inquiry_Mode"}, //0x0004
    { L"HCI_Create_Connection"}, //0x0005  
    { L"HCI_Disconnect"}, //0x0006, 
    { L""}, //0x0007,
    { L"HCI_Create_Connection_Cancel"}, //0x0008, 
    { L"HCI_Accept_Connection_Request"}, //0x0009 
    { L"HCI_Reject_Connection_Request"}, //0x000A 
    { L"HCI_Link_Key_Request_Reply"}, //0x000B 
    { L"HCI_Link_Key_Request_Negative_Reply"}, //0x000C 
    { L"HCI_PIN_Code_Request_Reply"}, //0x000D
    { L"HCI_PIN_Code_Request_Negative_Reply"}, //0x000E 
    { L"HCI_Change_Connection_Packet_Type"}, //0x000F 
    { L""}, //0x0010 
    { L"HCI_Authentication_Requested"}, //0x0011
    { L""}, //0x0012 
    { L"HCI_Set_Connection_Encryption"}, //0x0013
    { L""}, //0x0014
    { L"HCI_Change_Connection_Link_Key"}, //0x0015 
    { L""}, //0x0016
    { L"HCI_Master_Link_Key"}, //0x0017
    { L""}, //0x0018
    { L"HCI_Remote_Name_Request"}, //0x0019
    { L"HCI_Remote_Name_Request_Cancel"}, //0x001A
    { L"HCI_Read_Remote_Supported_Features"}, //0x001B
    { L"HCI_Read_Remote_Extended_Features"}, //0x001C
    { L"HCI_Read_Remote_Version_Information"}, //0x001D
    { L""}, //0x001E
    { L"HCI_Read_Clock_Offset"}, //0x001F
    { L"HCI_Read_LMP_Handle"}, //0x0020
    { L""}, //0x0021
    { L""}, //0x0022
    { L""}, //0x0023
    { L""}, //0x0024
    { L""}, //0x0025
    { L""}, //0x0026
    { L""}, //0x0027
    { L"HCI_Setup_Synchronous_Connection"}, //0x0028
    { L"HCI_Accept_Synchronous_Connection_Request"}, //0x0029
    { L"HCI_Reject_Synchronous_Connection_Request"}, //0x002A
    { L"invalid"} //0x0100
};

static command_mappingg_t Link_Policy_Command_String[] =
{
    { L""}, //0x0000
    { L"HCI_Hold_Mode"}, //0x0001
    { L""}, //0x0002
    { L"HCI_Sniff_Mode"}, //0x0003
    { L"HCI_Exit_Sniff_Mode"}, //0x0004
    { L"HCI_Park_State"}, //0x0005
    { L"HCI_Exit_Park_State"}, //0x0006
    { L"HCI_QoS_Setup"}, //0x0007
    { L""}, //0x0008
    { L"HCI_Role_Discovery"}, //0x0009 
    { L""}, //0x000A 
    { L"HCI_Switch_Role"}, //0x000B
    { L"HCI_Read_Link_Policy_Settings"}, //0x000C 
    { L"HCI_Write_Link_Policy_Settings"}, //0x000D 
    { L"HCI_Read_Default_Link_Policy_Settings"}, //0x000E
    { L"HCI_Write_Default_Link_Policy_Settings"}, //0x000F 
    { L"HCI_Flow_Specification"}, //0x0010
    { L"invalid"} //0x0100
};

static command_mappingg_t Controller_And_Baseband_Command_String[] =
{
    { L""}, //0x0000 
    { L"HCI_Set_Event_Mask"}, //0x0001
    { L""}, //0x0002
    { L"HCI_Reset"}, //0x0003 
    { L""}, //0x0004
    { L"HCI_Set_Event_Filter"}, //0x0005
    { L""}, //0x0006
    { L""}, //0x0007
    { L"HCI_Flush"}, //0x0008
    { L"HCI_Read_PIN_Type"}, //0x0009
    { L"HCI_Write_PIN_Type"}, //0x000A
    { L"HCI_Create_New_Unit_Key"}, //0x000B
    { L""}, //0x000C
    { L"HCI_Read_Stored_Link_Key"}, //0x000D
    { L""}, //0x000E
    { L""}, //0x000F
    { L""}, //0x0010
    { L"HCI_Write_Stored_Link_Key"}, //0x0011
    { L"HCI_Delete_Stored_Link_Key"}, //0x0012
    { L"HCI_Write_Local_Name"}, //0x0013 
    { L"HCI_Read_Local_Name"}, //0x0014 
    { L"HCI_Read_Connection_Accept_Timeout"}, //0x0015
    { L"HCI_Write_Connection_Accept_Timeout"}, //0x0016
    { L"HCI_Read_Page_Timeout"}, //0x0017
    { L"HCI_Write_Page_Timeout"}, //0x0018
    { L"HCI_Read_Scan_Enable"}, //0x0019 
    { L"HCI_Write_Scan_Enable"}, //0x001A 
    { L"HCI_Read_Page_Scan_Activity"}, //0x001B
    { L"HCI_Write_Page_Scan_Activity"}, //0x001C
    { L"HCI_Read_Inquiry_Scan_Activity"}, //0x001D 
    { L"HCI_Write_Inquiry_Scan_Activity"}, //0x001E
    { L"HCI_Read_Authentication_Enable"}, //0x001F
    { L"HCI_Write_Authentication_Enable"}, //0x0020
    { L"HCI_Read_Encryption_Mode"}, //0x0021
    { L"HCI_Write_Encryption_Mode"}, //0x0022
    { L"HCI_Read_Class_of_Device"}, //0x0023
    { L"HCI_Write_Class_of_Device"}, //0x0024
    { L"HCI_Read_Voice_Setting"}, //0x0025
    { L"HCI_Write_Voice_Setting"}, //0x0026
    { L"HCI_Read_Automatic_Flush_Timeout"}, //0x0027
    { L"HCI_Write_Automatic_Flush_Timeout"}, //0x0028
    { L"HCI_Read_Num_Broadcast_Retransmissions"}, //0x0029
    { L"HCI_Write_Num_Broadcast_Retransmissions"}, //0x002A
    { L"HCI_Read_Hold_Mode_Activity"}, //0x002B 
    { L"HCI_Write_Hold_Mode_Activity"}, //0x002C
    { L"HCI_Read_Transmit_Power_Level"}, //0x002D
    { L"HCI_Read_Synchronous_Flow_Control_Enable"}, //0x002E
    { L"HCI_Write_Synchronous_Flow_Control_Enable"}, //0x002F
    { L""}, //0x0030 
    { L"HCI_Set_Control_To_Host_Flow_Control"}, //0x0031
    { L""}, //0x0032
    { L"HCI_Host_Buffer_Size"}, //0x0033
    { L""}, //0x0034
    { L"HCI_Host_Number_OF_Completed_Packets"}, //0x0035
    { L"HCI_Read_Link_Supervision_Timeout"}, //0x0036
    { L"HCI_Write_Link_Supervision_Timeout"}, //0x0037
    { L"HCI_Read_Number_Of_Supported_IAC"}, //0x0038
    { L"HCI_Read_Current_IAC_LAP"}, //0x0039 
    { L"HCI_Write_Current_IAC_LAP"}, //0x003A
    { L"HCI_Read_Page_Scan_Period_Mode"}, //0x003B
    { L"HCI_Write_Page_Scan_Period_Mode"}, //0x003C
    { L""}, //0x003D
    { L""}, //0x003E
    { L"Set_AFH_Host_Channel_Classification"}, //0x003F
    { L""}, //0x0040
    { L""}, //0x0041 
    { L"HCI_Read_Inquiry_Scan_Type"}, //0x0042
    { L"HCI_Write_Inquiry_Scan_Type"}, //0x0043
    { L"HCI_Read_Inquiry_Mode"}, //0x0044
    { L"HCI_Write_Inquiry_Mode"}, //0x0045
    { L"HCI_Read_Page_Scan_Type"}, //0x0046
    { L"HCI_Write_Page_Scan_Type"}, //0x0047
    { L"Read_AFH_Channel_Assessment_Mode"}, //0x0048
    { L"Write_AFH_Channel_Assessment_Mode"}, //0x0049
    { L"invalid"}  //0x0100
};

static command_mappingg_t Informational_Parameters_String[] =
{
    { L""}, //0x0000
    { L"HCI_Read_Local_Version_Information"}, //0x0001
    { L"HCI_Read_Local_Supported_Commands"}, //0x0002
    { L"HCI_Read_Local_Supported_Features"}, //0x0003
    { L"HCI_Read_Local_Extended_Features"}, //0x0004 
    { L"HCI_Read_Buffer_Size"}, //0x0005
    { L""}, //0x0006
    { L""}, //0x0007
    { L""}, //0x0008 
    { L"HCI_Read_BD_ADDR"}, //0x0009
    { L"invalid"}//0x0100
};

static command_mappingg_t Status_Parameters_String[] =
{
    { L""}, //0x0000
    { L"HCI_Read_Failed_Contact_Counter"}, //0x0001
    { L"HCI_Reset_Failed_Contact_Counter"}, //0x0002
    { L"HCI_Read_Link_Quality"}, //0x0003
    { L""}, //0x0004
    { L"HCI_Read_RSSI"}, //0x0005
    { L"Read_AFH_Channel_Map"}, //0x0006
    { L"HCI_Read_Clock"}, //0x0007
    { L"invalid"} //0x0100
};

static command_mappingg_t Testing_Commands_String[] =
{
    { L""}, //0x0000
    { L"HCI_Read_Loopback_Mode"}, //0x0001
    { L"HCI_Write_Loopback_Mode"}, //0x0002
    { L"HCI_Enable_Device_Under_Test_Mode"}, //0x0003
    { L"invalid"} //0x0100
};

void HCI_EventInfo(PUCHAR buffer,USHORT buffer_len);
void HCI_CommandInfo(unsigned char *buffer);

#ifdef __cplusplus
}
#endif  //__cplusplus
#endif  /* #ifndef _BT_DEBUG_H_ */
